import glob
template = """ {"pk": %d, "model": "raster_stats.rasterdataset", "fields": {"type": "continuous", "name": "%s", "filepath": "/usr/local/src/marinethreats/data/threats/%s_model_avg_wgs84.tif"}}, """

impacts = [x.strip() for x in open('impact_layers.txt').readlines()]
count = 1
for i in impacts:
    print template % (count, i, i)
    count += 1

mods = [x.replace('.txt','') for x in glob.glob('alt_*.txt')] 
template = """ {"pk": %d, "model": "raster_stats.rasterdataset", "fields": {"type": "continuous", "name": "%s", "filepath": "/usr/local/src/marinethreats/data/out/%s_wgs84.tif"}}, """
for i in mods:
    print template % (count, i, i)
    count += 1
